<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src='./dist/jquery-3.2.1.js'></script>
	<title></title>
</head>
<style type="text/css">
/*	div{
		width:300px;
		height:300px;
		background:#ccc;
		padding:10px;
		border:10px solid #0f0;
	}*/
	.shop{
		width:200px;
		height:200px;
		overflow:hidden;
		box-shadow:0px 0px 5px 5px #ccc;
		float:left;
		margin-left:40px;
		margin-top:10px;
	}
	.img{
		position:absolute;
		border:10px solid #ccc;
		border-radius:200px;
		overflow:hidden;
		display:none;
		width:200px;
		height:200px;
	}
	.main{

		width:1000px;
		height:500px;
		position:absolute;
		left:50%;
		top:50%;
		margin-left:-500px;
		margin-top:-250px;
		box-shadow:0px 0px 5px 5px #000;
	}
</style>
<body>

<h1>1.尺寸</h1>
	<div><img src="jiu.jpg"></div>
	
<h1>2.获取三个高度</h1>

<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
v
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
v
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>
<h1>THE Antelope had traversed all the waters of the Baie de Chaleur, and the enterprising voyageurs on board had met with many adventures by sea and land; and at length all these were exhausted, and, as the time drew near for their departure, the question arose where next to go, which question was discussed in full council assembled upon the deck; present Bruce, Arthur, Bart, Tom, Phil, Pat, Captain Corbet, Wade, and Solomon, Bruce being in the chair—that is to say, on the taffrail. “All you that are in </h1>



<h1>3.获取位置坐标</h1>
<div class="main">
<div class="img"><img src="3.jpg"></div>
<div class="shop"><img src="2.png" width='100%'></div>
<div class="shop"><img src="2.png" width='100%'></div>
<div class="shop"><img src="2.png" width='100%'></div>
</div>


</body>
<script type="text/javascript">
//1.尺寸
$('div').click(function(){
	//内部宽高加上内边距
	 x=$(this).innerHeight();
	 y=$(this).innerWidth();
//内部宽高加内边距加边框
	x=$(this).outerHeight();
	y=$(this).outerWidth();
	//图片自身的宽高
	x=$(this).height();
	y=$(this).width();
	alert(x+'-'+y);
})



//2.获取三个高
//获取文档的可视区域的高度
x=$(window).width();
y=$(window).height();
alert(x+'-'+y);
//获取滚动的高度
$(window).scroll(function(){
	h=$(window).scrollTop();
	document.title=h;
});
//文档总高度
w=$(document).height();



//3.获取坐标位置
//获取标签相对于文档左上角的坐标
$('.shop').mouseenter(function(){
x=$(this).offset().left;
y=$(this).offset().top+310;
$('.img').show().css({'left':x+'px','top':y+'px'});
});


//获取子标签对父标签的相对坐标
$('.shop').mouseenter(function(){
x=$(this).position().left+40;
y=$(this).position().top+10+200;
document.title=x+'-'+y;
$('.img').show().css({'top':y+'px','left':x+'px'});
});
</script>
</html>